package cn.gok.client.service;

import cn.gok.common.entity.customer.CustomerBalanceLog;
import cn.gok.common.entity.customer.CustomerConsignee;
import cn.gok.common.entity.customer.CustomerInfo;
import cn.gok.common.entity.customer.CustomerLogin;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 * @author: shikundai
 * @Time: 2020/9/27  11:08
 * @description: 顾客信息的业务逻辑层
 */
@Service
public interface CustomerService {
    /**
     * Description: 添加顾客信息
     *
     * @param customerConsignee 顾客地址
     * @param customerInfo      顾客信息
     * @param customerLogin     顾客登录信息
     * @return
     * @author: shikundai
     * @date: 2020/10/11 11:14
     */
    public boolean addCustomer(CustomerLogin customerLogin, CustomerInfo customerInfo, CustomerConsignee customerConsignee);

    /**
     * 描述：验证注册号是否存在 存在返回true 不存在返回false
     *
     * @param loginName 登录名
     * @return
     * @author: shikundai
     * @date: 2020/10/20
     * @time: 9:50
     */
    public boolean verificationLoginName(String loginName);

    /**
     * @author shikundai
     * @date 2020/11/1
     * @time 17:11
     * @description 顾客登录
     */
    public boolean login(HttpServletRequest req, CustomerLogin customerLogin);

    /**
     * @return Map :顾客登录信息、顾客详细信息、顾客地址
     * @author shikundai
     * @date 2020/11/5
     * @time 11:35
     * @description 通过顾客信息获取顾客ID
     */
    public Map getCustomerMsg(String customerID);

    /**
     * @author shikundai
     * @date 2020/11/9
     * @time 7:49
     * @description 保存顾客信息（顾客信息修改）
     */
    public boolean updateCustomer(CustomerInfo customerInfo);

    /**
     * @param customerId 顾客ID
     * @param oldPsw     旧密码
     * @param psw        新密码
     * @author shikundai
     * @date 2020/11/9
     * @time 9:20
     * @description 顾客密码修改
     */
    public boolean updatePsw(String customerId, String oldPsw, String psw);

    /**
     * 描述：获取顾客金额变动记录
     *
     * @param time     时间形式xxxx-mm-dd
     * @param page     页数
     * @param pageSize 页面大小
     * @author shikundai
     * @date 2020/12/11
     * @time 9:46
     * @return 分页信息
     */
    public PageInfo<CustomerBalanceLog> getCustomerBalanceLog(String time, int page, int pageSize);

}
